1. Field of the Invention
This invention relates to a network switching apparatus and method, and more particularly to a network switching apparatus and method being provided for congestion control.
2. Description of Related Art
A network switch can allow a number of workstations or local area network (LAN), which have been connected to the switch, to simultaneously transceive data information, so as to enhance the performance of the whole network. In order to achieve the switching purpose, the switching apparatus should record the connection operation that which one of the workstation or LAN is connected to which one of the connection port. This is in other words like the address learning function of a bridge. When the switching apparatus receives a data packet, it first goes to the forwarding table to look up the target port in response to the data packet. If it can be found from the table, then the data packet is exported to the target port, which connects the target of workstation or LAN. If it is not found from the table, then this data packet is broadcasted to all of the connection ports, so as to ensure that the target of workstation or LAN can receive the data packet.
Referring to FIG. 1, it schematically illustrates a conventional network switching apparatus. A network switching apparatus 100 is connected with a number of work-stations or LANs 130. The network switching apparatus 100 includes a network switching controller 110, a share buffer 120, and a plurality of connection ports 115. The connection ports 115 are connected with the workstations or LANs 130. The switching apparatus 100 receives a data packet from these workstations or LANs 130 through the connection ports 115. The data packet is then forwarded to the workstation or LAN 130 as intended by the data packet. The network switching controller 110 is connected to the share buffer 120. The network switching controller 110 that temporarily stores the data packet into the share buffer 120. After the target connection port, which is intended by the data packet, is determined for output. And then, the packet is transmitted to the target workstation or LAN 130 through the target connection port.
According to the standard of the IEEE 802.3u protocol, the auto-negotiation function is incorporated therein to allow the network switching apparatus and Ethernet adapters of the workstation or LAN can perform the auto-negotiation between each other, so as to obtain the status of each other, such as the information about the transceiving speed for the Ethernet adapter, or types of full duplex or half duplex, and so on. Also and the transmission mode between each other is negotiated to have the best mode. Full duplex is superior to half duplex. The faster speed of 100M is superior to the slower speed of 10M. After the best one of transmission mode is negotiated, in order to increase the throughput, the switching apparatus can further provide congestion control, so as to allow the data packets in the switching apparatus to be transmitted. In the share buffer 120, those portions of memory not being used yet are called the free buffers. When the number of the free buffers is zero, the congestion must occur. Due to this reason, the congestion control should be performed before the congestion occurs, so as to prevent the congestion from occurring.
Referring to FIG. 2, it schematically illustrates an example of the congestion occurring on the Ethernet switching controller 110. Assume all of the connection ports having the same transmitting speed of 100 Mbps, the connection ports 1,2, and 3 are serving as the source ports, and the connection ports 4, 5, and 6 are serving as the target ports. For the situation, the connection port 2 is transmitting data packets to the connection port 5 with 100% bandwidth, and at the same time the connection port 1 is transmitting data packets to the connection ports 4 and 5 with 50% bandwidth respectively, and the connection port 3 is transmitting data packets to the connection port 6 with 100% bandwidth. In this situation, the transmitting speed for transmitting to the connection port 5 is then 150 Mbps, which speed has been over maximum diverting ability of the connection port 5. Therefore, the data packets will be gathered at the connection port 5. This would cause that the free buffers in the share buffer 120 will be used up.If the free buffers in the share buffer 120 are used up, then it will cause the other connection ports cannot properly work in the normal condition, and a congestion situation will occur. Conventionally, the network switching apparatus, according to the connected Ethernet adapter of the workstation or LAN, usually provides three types of congestion controls. (1) When the connected one is a half duplex device, backpressure control is adopted, that is, the switching apparatus issues a collision signal, to damage the data packet. When the source workstation or LAN has detected the collision signal, the data packet will be transmitted again after waiting for a certain period of time. (2) When the connected device has the function of full duplex but has no ability to perform the flow control, drop control is adopted. A full duplex device implies that the transmitting action and receiving action can be performed at the same time through the different transmission lines, such that the collision signal cannot be used. In this situation, the switching apparatus therefore drops the data packet at the destination port without occupying any free buffer. (3) When the connected device has the function of full duplex and has the ability to perform the flow control, flow control is adopted. The switching apparatus can issue a pause signal to the source workstation or LAN for flow control so that the source port will not send any packet to the destination port for a period, and then the purpose to alleviate the situation of congestion occurring on the connection port can be achieved.
The U.S. Pat. No. 4,942,569 has introduced a method for sequentially exporting the data packets according to the priority of them. However, the conventional method of congestion control is still not enough to solve the large amount of network flow, which increases day by day. In fact, it has been the object strongly desired by the manufacturers to find a method of congestion control to have better efficiency.